﻿using System;
using System.Data;
using System.Linq;
using ReflectionStudio.Core.Events;
namespace WPFExcelReport
{
    public partial class ITXEXRPT
    {

        private void JLTRWBB13(DataSet db)
        {
            try
            {
                DataTable dtSoruce = db.Tables["WBBEW"];
                DataTable dtOutput = new DataTable();
                dtOutput.Columns.Add("TYP", typeof(System.String));
                dtOutput.Columns.Add("WBEWART", typeof(System.String));
                dtOutput.Columns.Add("WBEWFARBE", typeof(System.String));
                dtOutput.Columns.Add("WABEZ", typeof(System.String));
                dtOutput.Columns.Add("DENSITY", typeof(System.String));
                dtOutput.Columns.Add("DES", typeof(System.String));
                dtOutput.Columns.Add("QTY", typeof(System.String));
                dtOutput.Columns.Add("WARP", typeof(System.String));
                dtOutput.Columns.Add("WEFT", typeof(System.String));
                dtOutput.Merge(dtSoruce, false, MissingSchemaAction.Ignore);
                foreach (DataRow row in dtOutput.Rows)
                {
                    row["TYP"] = GetGB2312Value(row["TYP"].ToString());
                    row["WABEZ"] = GetGB2312Value(row["WABEZ"].ToString());
                    row["DES"] = GetGB2312Value(row["DES"].ToString());
                    row["WARP"] = GetGB2312Value(row["WARP"].ToString());
                    row["WEFT"] = GetGB2312Value(row["WEFT"].ToString());
                }
                exAgent.DataTableToExcel(dtOutput, 2, 1);

                int count = dtOutput.Rows.Count;
                exAgent.SetCellValue(1, 1, 1);
                exAgent.BatchConvert2Number(2, 7, count + 1, 7);
                exAgent.SetCellValue(1, 1, "织机类型");

            }
            catch (Exception ex)
            {
                Tracer.Error(ex.StackTrace, ex);
            }
        }
        
    }
}